#!/bin/sh

DIR=/tmp/imgur
VAR=$(curl --silent $1 | grep ' : {"id"' | grep -o "hash.........." | sed '1,2d' | sed 's/.*:"//')
NUM=0

rm -rf $DIR
mkdir $DIR

for i in $VAR
do
	wget -O $DIR/$NUM.png "https://i.imgur.com/$i.png" 1>/dev/null
	let NUM++
done

sxiv $DIR/
